import QtQuick 2.15
import QtQuick.Controls 2.15
Item {
    id: root
    ScrollView
    {
        id:scrollView
        anchors.centerIn: parent
        width: 160*mymodbus.axisCount>root.width?root.width:160*mymodbus.axisCount
        clip: true
        height: root.height
        Grid{　　// Row、Column、Flow
            //horizontalCenter: Grid.horizontalCenter
                       width: 160*mymodbus.axisCount
                       height:120
                       rows:1
                       id:grid
                       anchors.margins: 8;
                       spacing: 4; // 间隔

                       Repeater{
                           model: mymodbus.axisCount;　　// 子项目个数
                           // Rectangle{
                           //     width: 200;
                           //     height: 200;
                           //     property int colorIndex: Math.floor(Math.random()*3);　　// Math.floor(Math.random()*3)生成0~2的随机数
                           //     color: root.colorArray[colorIndex];
                           //     border.color: Qt.lighter(color);
                           //     Text {
                           //         anchors.centerIn: parent;
                           //         color: "#f0f0f0";
                           //         text: "Cell " + index
                           //     }
                           // }
                           delegate:  WeigherCard{
                               width:150
                                   //360/(mymodbus.axisCount+1)
                               no:index
                               //addrIndex: index < addrs.length ? addrs[index] : -1
                           }
                       }
                   }
    }
}

